package cn.xcyy.itcc.exception;


import cn.xcyy.itcc.enums.GlodalErrorCode;
import lombok.Data;

@Data
public class GlobalCustomException extends RuntimeException {

    private String errorMessage;

    private String errorCode;

    public GlobalCustomException() {
    }

    public GlobalCustomException(String message) {
        super(message);
    }

    public GlobalCustomException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }

    public GlobalCustomException(GlodalErrorCode glodalErrorCode) {
        super(glodalErrorCode.getMessage());
        this.errorMessage = glodalErrorCode.getMessage();
        this.errorCode = glodalErrorCode.getCode();
    }
}
